// api/combo.js
import http from '@/utils/request'

/**
 * 查询套餐分页数据
 * @param {Object} params - 分页参数
 */
export function getSetmealPage(params) {
    return http.get('/setmeal/page', { params })
}

/**
 * 删除套餐
 * @param {Array|String} ids - 套餐ID数组或字符串
 */
export function deleteSetmeal(ids) {
    return http.delete('/setmeal', { params: { ids } })
}

/**
 * 新增套餐
 * @param {Object} params - 套餐信息
 */
export function addSetmeal(params) {
    return http.post('/setmeal', params)
}

/**
 * 编辑套餐
 * @param {Object} params - 套餐信息
 */
export function editSetmeal(params) {
    return http.put('/setmeal', params)
}

/**
 * 根据ID查询套餐详情
 * @param {String|Number} id - 套餐ID
 */
export function querySetmealById(id) {
    return http.get(`/setmeal/${id}`)
}

/**
 * 批量修改套餐状态
 * @param {Object} params - { status, ids }
 */
export function setmealStatusByStatus(params) {
    return http.post(`/setmeal/status/${params.status}`, null, {
        params: { ids: params.ids }
    })
}
